function GPAccessErrorHandler(error, error_description) {
    console.log("There was an error: " + error + "(" + error_description + ")");
    $('#gp-hello').html("");
    $('.gp-img').attr("src","");
}

function GPNotAuthorizedHandler() {
    console.log("Empty authResult");  // Qualcosa è andato storto
    $('#gp-hello').html("");
    $('.gp-img').attr("src","");
}

function GPConnectedHandler(response) {
    $('#gp-hello').html('Recupero informazioni profilo...');
    
    $('#gp-hello').html("Benvenut" + (response["gender"]==="male" ? "o" : "a") + "<br><b>" + response["name"] + "</b>!");
    $('.gp-img').removeClass('hide').attr("src",response["picture"]);

    $('.gp-login-button').addClass('hide');
    $('.gp-logout-button').removeClass('hide');
}
/* /Google+ Email Request */

/* Google+ Disconnect Handler */
$("#gp-signout-button").click(function(e) {
    gapi.auth.signOut();
});
/* /Google+ Disconnect Handler */